package fei.yuzhi.com.loveflowers.fragment.firstpagefragment.detail.evaluate;

import fei.yuzhi.com.loveflowers.bean.evaluatebean.EvaluateBean;

/**
 * Created by My on 2016/10/18.
 */
public class EvaluatePresenter implements EvaluateContract.IEvaluatePresenter {
    private EvaluateContract.IEvaluateModel model;
    private EvaluateContract.IEvaluateView view;
    public EvaluatePresenter(EvaluateContract.IEvaluateView view){
        this.view=view;
        model=new EvaluateModel();
    }

    @Override
    public void getEvaluateBean(String data) {
        model.getEvaluateBean(data, new EvaluateModel.onSendEvaluateBeanListener() {
            @Override
            public void sendEvaluateBean(EvaluateBean evaluateBean) {
                if (evaluateBean!=null){
                    view.getEvaluateBeanSuccess(evaluateBean);
                }else {
                    view.getEvaluateBeanFail("retrofit网络数据加载失败");
                }
            }
        });
    }
}
